import { axios, get, post } from './http'


export const ajax = {

    //注册
    getRegister: (body, headers) => post('/vue/register', body, headers),

    //登录
    getLogin: (body, headers) => post('/vue/login', body, headers),

    //检测用户名是否被注册
    checkUsername: (body) => post('/vue/checkUsername', body),

    //检测手机号是否被注册
    checkPhone: (body) => post('/vue/checkPhone', body),

    // 获取用户信息 
    getuserinfo: (params) => get("/vue/getuserinfo", params),

    // 上传头像 
    uploadavatar: (params) => post("/vue/uploadavatar", params),

    //发送验证码
    getCaptcha: (params, headers) => get('http://39.100.106.156:3333/captcha/sent', params, headers),

    //验证验证码
    getVerify: (params, headers) => get('http://39.100.106.156:3333/captcha/verify', params, headers),

    //获取精品碟歌单
    getMusicList: (params, headers) => get('http://39.100.106.156:3333/top/playlist', params, headers),

    //获取精品碟歌单详情
    getMusicListInfo: (params, headers) => get('http://39.100.106.156:3333/playlist/detail', params, headers),

    //获取轮播图  传type值  可为0,1,2,3
    getBanner: (params) => get("http://39.100.106.156:3333/banner", params),

    //获取推荐歌单 传limit  获取指定条数
    getRecommentdList:(params)=>get("http://39.100.106.156:3333/personalized",params),

    //获取精品歌单 传limit  获取指定条数
    getQualityList:(params)=>get("http://39.100.106.156:3333/top/playlist/highquality",params),

    //获取歌单详情 传id  获取指定歌单详情
    getSongId:(params)=>get("http://39.100.106.156:3333/playlist/detail",params),

    //获取歌曲详情 传ids  
    getMusic:(params)=>get("http://39.100.106.156:3333/song/detail",params),

    //获取歌曲url 传id  
    getMusicUrl:(params)=>get("http://39.100.106.156:3333/song/url",params),

    //获取热门歌单分类 
    catlistHot:(params)=>get("http://39.100.106.156:3333/playlist/hot",params),

    //获取指定类别歌单信息 
    getcatlists:(params)=>get("http://39.100.106.156:3333/top/playlist",params),

     //获取最新MV  传limit  获取指定条数
     getNewMv:(params)=>get("http://39.100.106.156:3333/mv/first",params),

     //获取推荐MV  传limit  获取指定条数
     getAllMv:(params)=>get("http://39.100.106.156:3333/mv/all",params),
 
     //获取MVurl  传id  获取指定url
     getMvUrl:(params)=>get("http://39.100.106.156:3333/mv/url",params),

     //获取默认搜索关键词 
     getDefault:(params)=>get("http://39.100.106.156:3333/search/default",params),

     //获取热搜列表(简略)
     getSearchHot:(params)=>get("http://39.100.106.156:3333/search/hot",params),

     //获取搜索     传入参数keywords 关键词  type: 搜索类型；默认为 1 即单曲 , 取值意义 : 1: 单曲, 10: 专辑, 100: 歌手, 1000: 歌单, 1002: 用户, 1004: MV, 1006: 歌词, 1009: 电台, 1014: 视频, 1018:综合
     getSearch:(params)=>get("http://39.100.106.156:3333/search",params),

     //获取歌手列表  参数 type 取值: -1:全部 1:男歌手 2:女歌手 3:乐队
     getSingerList:(params)=>get("http://39.100.106.156:3333/artist/list",params),

     //获取歌手热门歌曲50首  传入歌手id
     getSingerMusic:(params)=>get("http://39.100.106.156:3333/artist/top/song",params),
     
}

